<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html >
<html>
<head>
<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body style="background-color: white;" class="gray-bg">
	<div class="ibox-content">
		<form class="form-horizontal m-t" id="signupForm" method="post" enctype="multipart/form-data">
		    <input type="hidden" name="id" value="${talentsRecommend.id }" />
		    <div class="form-group">
				<label class="col-sm-3 control-label">推荐状态：</label>
				<div class="col-sm-8">
					<select id="status" name="status" class="form-control">
					        <option value="">====请选择===</option>
						<c:forEach items="${fns:getDictList('rec_status')}" var="temp" varStatus="vs">
							<option value="${temp.value }" <c:if test="${temp.value eq talentsRecommend.status}"> selected="selected"</c:if>>${temp.valueName }</option>
						</c:forEach>
					</select>
				    <p class="help-block" style="color: red;">*根据推荐情况，选择修改项。</p>
				</div>
			</div>
			<div class="form-group" style="text-align: center;">
				<div class="col-sm-8 col-sm-offset-3">
					<button class="btn btn-primary" type="button" id="sub">提交</button>
				</div>
			</div>
		</form>
	</div>


	<script>
    $(function () {
    	 $("#sub").click(function () {
    	//批量验证表单非空
		//调用方式
    	var arr=new Array(
    	  new Array('status','推荐状态未选择')
    	)
    	 for(var i=0;i<arr.length;i++){
        	  if($("#"+arr[i][0]).val()==''){
        		  $("#"+arr[i][0]).tips({
  					side:3,
  		            msg:arr[i][1],
  		            bg:'#AE81FF',
  		            time:1
  		        });
        		  $("#"+arr[i][0]).focus();
  				return;
  			}
    	  }
          $("#signupForm").ajaxSubmit({
              url: '<%=contextPath%>/talentsRecommend/updateStatus',
              type: 'post',
              dataType: "json",
              success: function (data) {
                  if (data.code == 200) {
                      swal({
                          title: data.message,
                          type: "success",
                          showCancelButton: false,
                          confirmButtonText: "确定",
                          animation: "slide-from-bottom",
                          closeOnConfirm: true
                      }, function () {
                          top.Dialog.close();
                      });
                  } else {
                      swal("错误", data.message, "error");
                  }
              }
          });
    	 });
    });
</script>
</body>
</html>